<!--
 * @Author: hucc
 * @Date: 2021-10-15 16:05:22
 * @LastEditors: hucc
 * @LastEditTime: 2021-10-16 20:41:03
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/axios.js"></script>
    <script src="../js/qs.js"></script>
    <script>
        const qs = Qs;
        //const baseUrl = "http://39.103.202.53:8888"
        const queryData = {
            page: 1,
            pageSize: 10
        }
        const loginData = {
            username: 'admin1',
            password: 123321
        }
        const applyData = {
                name: 'tom',
                age: 12,
                telephone: 1236668888,
                gender: 'male'
            }
            //全局设置axios默认值
        axios.defaults.baseURL = "http://39.103.202.53:8888"
        axios.defaults.headers.common['auto'] = 'zs'
        axios.defaults.headers.post['Authorization'] = 'token'
        axios.get('/index/category/findAll', {
                // baseURL: "http://39.103.202.53:8888",
                params: {
                    page: 1,
                    pageSize: 10
                }
            }).then(res => {
                console.log(res.data.data);
            })
            //axios表头格式默认是json格式
        axios.post(
            '/user/login',
            loginData, {
                //baseURL: "http://39.103.202.53:8888",
            }
        ).then(res => {
            console.log(res.data.data)
        })
    </script>
</head>

<body>

</body>

</html>